import { _decorator, Component, Node, Vec3, ColliderComponent } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Bullet')
export class Bullet extends Component {
    speed: number = 300; // 子弹移动速度
    damage = 10 // 子弹伤害值
    start() {

    }

    update(deltaTime: number) {
        // 子弹每帧向前移动
        if(this.node) this.node.translate(new Vec3(this.speed * deltaTime, 0, 0));
    }
}


